/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ipo.mm.ejb.entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author makcro
 */
@Entity
@Table(name = "ACTIONS")
@NamedQueries({

    @NamedQuery(name = "Actions.findAll", query = "SELECT a FROM Actions a"),
    @NamedQuery(name = "Actions.findById", query = "SELECT a FROM Actions a WHERE a.id = :id"),
    @NamedQuery(name = "Actions.findByStatus", query = "SELECT a FROM Actions a WHERE a.status = :status"),
    @NamedQuery(name = "Actions.findByActionText", query = "SELECT a FROM Actions a WHERE a.actionText = :actionText"),
    @NamedQuery(name = "Actions.findByName", query = "SELECT a FROM Actions a WHERE a.name = :name"),
    @NamedQuery(name = "Actions.findByDueDate", query = "SELECT a FROM Actions a WHERE a.dueDate = :dueDate"),
    @NamedQuery(name = "Actions.findByDeleted", query = "SELECT a FROM Actions a WHERE a.deleted = :deleted"),

    @NamedQuery(name = "Actions.findAllNotDeleted", query = "SELECT a FROM Actions a WHERE a.deleted = false"),
    @NamedQuery(name = "Actions.findAllNotDeletedCount", query = "SELECT COUNT(a) FROM Actions a WHERE a.deleted = false"),
    @NamedQuery(name = "Actions.findByStatusNotDeletedCount", query = "SELECT COUNT(a) FROM Actions a WHERE a.status = :status AND a.deleted = false"),
    @NamedQuery(name = "Actions.findByStatusNotDeleted", query = "SELECT a FROM Actions a WHERE a.status = :status AND a.deleted = false")

})
public class Actions implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "Id")
    private Integer id;
    @Column(name = "Status")
    private String status;
    @Column(name = "ActionText")
    private String actionText;
    @Column(name = "Name")
    private String name;
    @Basic(optional = false)
    @Column(name = "DueDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dueDate;
    @Column(name = "Deleted")
    private Boolean deleted;
    @JoinColumn(name = "MeetingId", referencedColumnName = "ID")
    @ManyToOne
    private Meeting meetingId;

    public Actions() {
    }

    public Actions(Integer id) {
        this.id = id;
    }

    public Actions(Integer id, Date dueDate) {
        this.id = id;
        this.dueDate = dueDate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getActionText() {
        return actionText;
    }

    public void setActionText(String actionText) {
        this.actionText = actionText;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getDueDate() {
        return dueDate;
    }

    public void setDueDate(Date dueDate) {
        this.dueDate = dueDate;
    }

    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    public Meeting getMeetingId() {
        return meetingId;
    }

    public void setMeetingId(Meeting meetingId) {
        this.meetingId = meetingId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Actions)) {
            return false;
        }
        Actions other = (Actions) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.ipo.mm.ejb.entities.Actions[id=" + id + "]";
    }

}
